A virtual memory system allows the logical address space of a process to be larger than the actual physical address space in memory that is occupied by the process during execution. The virtual memory system expands the addressing capabilities of processes beyond the in-core memory limitations of the host data processing system. Virtual memory is also important for system performance in supporting concurrent execution of multiple processes.
Various hardware and software mechanisms are used in translating virtual addresses to physical addresses. For example, a translation look-aside buffer (TLB) in a virtual memory system is a cache of recently accessed virtual-to-physical page address translations. The TLB may be implemented as a hardware structure in order to reduce the time taken to translate virtual to physical addresses and thereby improve system performance.
It has been recognized that system performance may benefit from the availability of different sizes of virtual memory pages. An application using a large page for certain data may benefit system performance where large blocks of data are contiguously stored in retentive storage. The availability of large pages may reduce contention for TLB resources. For example, without large pages multiple smaller pages would be required for the same data, and multiple pages would require multiple entries in the TLB. A large page leaves space in the TLB for other entries for other pages. Whether it is beneficial to store data in a large page or a small page depends on application requirements.
Circumstances may arise during the course of executing a process that make demoting a page desirable. Demotion generally involves dividing a page into multiple smaller pages. An example situation leading to demotion of a page involves requiring exclusive access to a portion of a page. Generally, the hardware may require the access characteristics for a page to be consistent across the entire page. Unless the single page is divided into multiple pages, there is no way to specify different access characteristics for different portions of the original page. It maybe desirable to demote a page because separating the portion of the a page denoted for exclusive access from the portion(s) that are not denoted for exclusive access by making multiple pages makes those portions not denoted for exclusive access accessible while access to the other portion is restricted.
Even though demoting a page may have the previously mentioned benefits, there may be negative implications for TLB performance. Specifically, a page that once occupied one entry in the TLB would after demotion occupy multiple entries in the TLB. This reduces the number of TLB spaces that are available for other processes. The system would then have to invoke replacement strategies to make room for pages of other processes or resort to translating a virtual address to a physical address during program execution.